package com.codeyourlife.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.codeyourlife.service.UserRelatedCourseService;
import com.codeyourlife.dao.UserRelatedCourseDao;
import com.codeyourlife.entity.Course;
import com.codeyourlife.entity.UserFavCourse;
import com.codeyourlife.entity.UserLearning;

@Service("UserRelatedCourseService")
public class UserRelatedCourseServiceImpl implements UserRelatedCourseService{
	
	@Autowired 
	private UserRelatedCourseDao userRelatedCourseDao;

	
	public void addUpCourse(Course course) {
		userRelatedCourseDao.addUpCourse(course);		
	}

	
	public List<Course> getExistUpCourse(int user_id) {		
		return userRelatedCourseDao.getUserUpCourse(user_id);
	}

	
	public void addUserFavCourse(UserFavCourse userFav) {
		userRelatedCourseDao.addUserFavCourse(userFav);
	}

	
	public void deleUserFavCourse(UserFavCourse userFav) {
		userRelatedCourseDao.deleUserFavCourse(userFav);
	}

	
	public List<Course> getUserFavCourse(int user_id) {
		return userRelatedCourseDao.getfavoriteCourse(user_id);
	}

	
	public void addUserLearning(UserLearning userLearning) {
		userRelatedCourseDao.addUserLearning(userLearning);
	}

	
	public void updateUserLearning(UserLearning userLearning) {
		userRelatedCourseDao.updateUserLearning(userLearning);
	}

	
	public List<Course> getUserLearning(int user_id) {
		return userRelatedCourseDao.getUserLearning(user_id);
	}

	
	public void addUserHistory(int user_id, UserLearning userLearning) {
		userRelatedCourseDao.addUserHistory(user_id, userLearning);	
	}

	
	public List<Course> getUserHistory(int user_id) {		
		return userRelatedCourseDao.getUserHistory(user_id);
	}


	public void deleteUserLearning(UserLearning userLearning) {
		userRelatedCourseDao.deleteUserLearning(userLearning);
		
	}

	
}
